﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
using System.Net;

namespace PASNew.U.Controls
{
    public partial class ContactusUC : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LBSubmit_Click(object sender, EventArgs e)
        {
            MailAddress FromMailAddress = new MailAddress("system.pas@gmailcom");
            MailAddress ToMailAddress = new MailAddress("ross.rawlins@gmail.com");
            MailMessage MailMsg = new MailMessage();
            MailMsg.From = FromMailAddress;
            MailMsg.To.Add(ToMailAddress);
            MailMsg.Subject = "PAS";

            MailMsg.Body = txtBoxContactUsName.Text + " " + txtBoxContactUsEmail.Text + " " + txtBoxContactNumber.Text + " " + txtBoxContactUsMesage.Text;
            NetworkCredential credentials = new NetworkCredential("support@passystem.co.za", "P@Ssyst3m");
            SmtpClient MailSender = new SmtpClient("mail.passystem.co.za");
            MailSender.Credentials = credentials;
            MailSender.Send(MailMsg);

            LblSuccess.Visible = true;
        }
    }
}